package com.softtown.modules.dapai.service.impl;


import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.softtown.common.service.impl.BaseServiceImpl;
import com.softtown.modules.dapai.dao.CompMacDao;
import com.softtown.modules.dapai.dao.CompMacStockDao;
import com.softtown.modules.dapai.dto.CompMacDTO;
import com.softtown.modules.dapai.entity.CompMacEntity;
import com.softtown.modules.dapai.service.CompMacDetailService;
import com.softtown.modules.dapai.service.CompMacStockService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
* @Author: Ding Ya Yong
* @Description: 设备
* @date: 2022/1/2 11:38
* @Param:
* @return:
*/

@Service
public class CompMacStockServiceImpl extends
        BaseServiceImpl<CompMacStockDao, CompMacEntity> implements CompMacStockService {



    @Override
    public PageInfo<CompMacDTO> getMacStockPageList(CompMacDTO compMacDTO) {
        Integer pageSize = compMacDTO.getPageSize();
        Integer page = compMacDTO.getPage();
        if (pageSize > 0 && page > 0) {
            PageHelper.startPage(page, pageSize);
        }
        List<CompMacDTO> compMacDTOList =
                baseDao.getMacStockPageList(compMacDTO.getCompId(), compMacDTO.getParam());
        return  new PageInfo<>(compMacDTOList);
    }

}
